/*****************************************************************************************
   
   Copyright (c) Microsoft Corporation. All rights reserved.

   Use of this code sample is subject to the terms of the Microsoft
   Permissive License, a copy of which should always be distributed with
   this file.  You can also access a copy of this license agreement at:
   http://www.microsoft.com/resources/sharedsource/licensingbasics/permissivelicense.mspx

 ****************************************************************************************/

using System;

namespace GrooveWebServicesV12Helpers.Forms
{
	/// <summary>
	/// Represents information about the properties of a FormsTool.
	/// </summary>
	public class ToolProperties
	{
		private GrooveWebServicesV12Helpers.Forms.FormsTool m_FormsTool;
		private GrooveWebServicesV12Helpers.Context m_Context;
		
		private GrooveWebServicesV12Helpers.GrooveFormsWebService.ToolProperties m_ToolProperties;

		public ToolProperties(GrooveWebServicesV12Helpers.Forms.FormsTool i_FormsTool, GrooveWebServicesV12Helpers.GrooveFormsWebService.ToolProperties i_ToolProperties)
		{
			m_FormsTool = i_FormsTool;
			m_Context = i_FormsTool.Context;

			m_ToolProperties = i_ToolProperties;
		}

		/// <summary>
		/// The FormsTool to which these properties apply.
		/// </summary>
		public GrooveWebServicesV12Helpers.Forms.FormsTool FormsTool
		{
			get
			{
				return m_FormsTool;
			}
		}

		/// <summary>
		/// The ID of the default form in the FormsTool.
		/// </summary>
		public string DefaultFormID
		{
			get
			{
				return m_ToolProperties.DefaultFormID;
			}
		}

		/// <summary>
		/// The name of the default form in the FormsTool.
		/// </summary>
		public string DefaultFormName
		{
			get
			{
				return m_ToolProperties.DefaultFormName;
			}
		}

		/// <summary>
		/// The URI of the default form in the FormsTool.
		/// </summary>
		public string DefaultFormURI
		{
			get
			{
				return m_ToolProperties.DefaultFormURI;
			}
		}

		/// <summary>
		/// The ID of the default view in the FormsTool.
		/// </summary>
		public string DefaultViewID
		{
			get
			{
				return m_ToolProperties.DefaultViewID;
			}
		}

		/// <summary>
		/// The name of the default view in the FormsTool.
		/// </summary>
		public string DefaultViewName
		{
			get
			{
				return m_ToolProperties.DefaultViewName;
			}
		}

		/// <summary>
		/// The URI of the default view in the FormsTool.
		/// </summary>
		public string DefaultViewURI
		{
			get
			{
				return m_ToolProperties.DefaultViewURI;
			}
		}

		/// <summary>
		/// True if this FormsTool allows search.
		/// </summary>
		public bool CanSearch
		{
			get
			{
				return m_ToolProperties.AllowSearch;
			}
		}

		/// <summary>
		/// True if the current user can create records in the tool.
		/// </summary>
		public bool CanCreateRecords
		{
			get
			{
				return m_ToolProperties.AllowRecordCreation;
			}
		}

		/// <summary>
		/// Specifies whether the Forms designer can run macros to the Forms tool.
		/// </summary>
		public bool CanRunMacros
		{
			get
			{
				return m_ToolProperties.AllowMacros;
			}
		}

		/// <summary>
		/// Specifies whether the Forms tool user can select different views.
		/// </summary>
		public bool CanChangeView
		{
			get
			{
				return m_ToolProperties.AllowChangeView;
			}
		}

		/// <summary>
		/// Specifies whether the Forms tool user accesses the records in Lists (views and forms) or as a Document (just in forms).
		/// </summary>
		public string ViewStyle
		{
			get
			{
				return m_ToolProperties.ViewStyle;
			}
		}

		/// <summary>
		/// The Design Template Name that is entered by the Forms designer on the Settings and Options About This Tool tab.
		/// </summary>
		public string DesignTemplateName
		{
			get
			{
				return m_ToolProperties.DesignTemplateName;
			}
		}

		/// <summary>
		/// The Design Template Version that is entered by the Forms designer on the Settings and Options About This Tool tab.
		/// </summary>
		public string DesignTemplateVersion
		{
			get
			{
				return m_ToolProperties.DesignTemplateVersion;
			}
		}

		/// <summary>
		/// The text that is entered by the Forms designer on the Settings and Options About This Tool tab. 
		/// </summary>
		public string AboutToolContents
		{
			get
			{
				return m_ToolProperties.AboutToolContents;
			}
		}
	}
}
